import requests
import pandas as pd
import json


# 获取每个币的标签信息
url = f'https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing?start=1&limit=20000&sortBy=market_cap&sortType=desc&convert=USD&' \
      f'cryptoType=all&tagType=all&audited=false&' \
      f'aux=tags'
a = requests.get(url,  timeout=30)
res = json.loads(a.text)
df = pd.DataFrame(res['data']['cryptoCurrencyList'])
df.to_csv('G:/data/coinmarketcap/coin_tags.csv', index=False)
